﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Model
{
    /// <summary>
    /// 出库明细表实体类，对应[dbo].[wh_outbound_detail]表
    /// </summary>
    public class WhOutboundDetail
    {
        /// <summary>
        /// 出库明细ID
        /// </summary>
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public long StockOutDetailId { get; set; }

        /// <summary>
        /// 出库订单ID（关联WhOutbound的StockOutOrderId，不允许为空）
        /// </summary>
        public long StockOutOrderId { get; set; }

        /// <summary>
        /// 批次ID
        /// </summary>
        public long? BatchId { get; set; }

        /// <summary>
        /// 商品编码
        /// </summary>
        [Required]
        [StringLength(50)]
        public string GoodsCode { get; set; }

        /// <summary>
        /// 产品单位
        /// </summary>
        [Required]
        [StringLength(10)]
        public string ProductUnit { get; set; }

        /// <summary>
        /// 存储位置ID
        /// </summary>
        public long StorageLocationId { get; set; }

        /// <summary>
        /// 出库单价
        /// </summary>
        public decimal OutStockUnitPrice { get; set; }

        /// <summary>
        /// 出库数量
        /// </summary>
        public decimal OutStockQuantity { get; set; }

        /// <summary>
        /// 批次号
        /// </summary>
        [StringLength(50)]
        public string BatchNo { get; set; }

        /// <summary>
        /// 生产日期
        /// </summary>
        public DateTime ProductionDate { get; set; }

        /// <summary>
        /// 是否删除
        /// </summary>
        [Required]
        [StringLength(1)]
        public string IsDelete { get; set; } = "0";

        /// <summary>
        /// 创建人ID
        /// </summary>
        public long CreateBy { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 更新人ID
        /// </summary>
        public long UpdateBy { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime UpdateTime { get; set; }

        /// <summary>
        /// 附件ID
        /// </summary>
        public long? AttachmentId { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [StringLength(500)]
        public string Remarks { get; set; }
    }
}
